<template>
  <div class="main w clearfix">
    <VideoInfo v-for="video in videoSearchList" :key="video.id" :video="video"/>
  </div>
</template>
<script setup lang="ts">
import VideoInfo from '@/components/VideoInfo.vue'
import {useVideoStore} from '@/stores'
import {computed, onMounted} from 'vue'
import {useRoute} from 'vue-router'

const store = useVideoStore()
const route = useRoute()

onMounted(() => {
  const keyword = <string>route.query.keyword
  store.getVideoSearchList(keyword)
})

let videoSearchList = computed(() => store.videoSearchList)
</script>

<style lang="less" scoped>
.main {
  margin-top: 30px;
}
</style>
